﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TwitterBobby
{
    public class MessageDTO
    {
        public int MessageID { get; set; }
        public string Text { get; set; }
        public DateTime MessageDate { get; set; }
        public int ChannelID { get; set; }

        public static MessageDTO CreateFromMessage(Message message)
        {
            MessageDTO result = new MessageDTO();
            result.ChannelID = message.ChannelID;
            result.MessageDate = message.MessageDate;
            result.Text = message.Text;
            result.MessageID = message.MessageID;
            return result;
        }

        public Message ToMessage()
        {
            Message result = new Message();
            result.MessageID = this.MessageID;
            result.MessageDate = this.MessageDate;
            result.Text = this.Text;
            result.ChannelID = this.ChannelID;
            return result;
        }
    }
}